<script setup>

    import userStore from '../store/userStore';
    let user = userStore(); //获取对象

    let change = ()=>{
        user.name = "二狗子";
        user.incrmentAge();
        console.log('名字长度：'+user.getNameLength);
        console.log('是否成年：'+user.getChengnian);
    }
</script>

<template>
  <div>
     <button @click="change()">修改pinia的数据</button>
  </div>
</template>

<style scoped>

</style>